package com.fujitsu.nanjing.tieba.dao;

import com.fujitsu.nanjing.tieba.ibator.CoreAdminLog;
import com.fujitsu.nanjing.tieba.ibator.CoreAdminLogCriteria;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class CoreAdminLogDAOImpl extends SqlMapClientDaoSupport implements CoreAdminLogDAO {

    public CoreAdminLogDAOImpl() {
        super();
    }

    public int countByExample(CoreAdminLogCriteria example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("core_admin_log.countByExample", example);
        return count;
    }

    public int deleteByExample(CoreAdminLogCriteria example) {
        int rows = getSqlMapClientTemplate().delete("core_admin_log.deleteByExample", example);
        return rows;
    }

    public int deleteByPrimaryKey(Integer logid) {
        CoreAdminLog _key = new CoreAdminLog();
        _key.setLogid(logid);
        int rows = getSqlMapClientTemplate().delete("core_admin_log.deleteByPrimaryKey", _key);
        return rows;
    }

    public void insert(CoreAdminLog record) {
        getSqlMapClientTemplate().insert("core_admin_log.insert", record);
    }

    public void insertSelective(CoreAdminLog record) {
        getSqlMapClientTemplate().insert("core_admin_log.insertSelective", record);
    }

    @SuppressWarnings("unchecked")
    public List<CoreAdminLog> selectByExample(CoreAdminLogCriteria example) {
        List<CoreAdminLog> list = getSqlMapClientTemplate().queryForList("core_admin_log.selectByExample", example);
        return list;
    }

    public CoreAdminLog selectByPrimaryKey(Integer logid) {
        CoreAdminLog _key = new CoreAdminLog();
        _key.setLogid(logid);
        CoreAdminLog record = (CoreAdminLog) getSqlMapClientTemplate().queryForObject("core_admin_log.selectByPrimaryKey", _key);
        return record;
    }

    public int updateByExampleSelective(CoreAdminLog record, CoreAdminLogCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_admin_log.updateByExampleSelective", parms);
        return rows;
    }

    public int updateByExample(CoreAdminLog record, CoreAdminLogCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_admin_log.updateByExample", parms);
        return rows;
    }

    public int updateByPrimaryKeySelective(CoreAdminLog record) {
        int rows = getSqlMapClientTemplate().update("core_admin_log.updateByPrimaryKeySelective", record);
        return rows;
    }

    public int updateByPrimaryKey(CoreAdminLog record) {
        int rows = getSqlMapClientTemplate().update("core_admin_log.updateByPrimaryKey", record);
        return rows;
    }

    protected static class UpdateByExampleParms extends CoreAdminLogCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, CoreAdminLogCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}